/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "identificationelement")
@NamedQueries({
    @NamedQuery(name = "Identificationelement.findAll", query = "SELECT i FROM Identificationelement i"),
    @NamedQuery(name = "Identificationelement.findByIdidentificationelement", query = "SELECT i FROM Identificationelement i WHERE i.ididentificationelement = :ididentificationelement"),
    @NamedQuery(name = "Identificationelement.findByDateidentified", query = "SELECT i FROM Identificationelement i WHERE i.dateidentified = :dateidentified"),
    @NamedQuery(name = "Identificationelement.findByIdentificationremark", query = "SELECT i FROM Identificationelement i WHERE i.identificationremark = :identificationremark")})
public class Identificationelement implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ididentificationelement")
    private Integer ididentificationelement;
    @Column(name = "dateidentified")
    @Temporal(TemporalType.DATE)
    private Date dateidentified;
    @Column(name = "identificationremark")
    private String identificationremark;
    @JoinTable(name = "identificationtypestatus", joinColumns = {
        @JoinColumn(name = "ididentificationelement", referencedColumnName = "ididentificationelement")}, inverseJoinColumns = {
        @JoinColumn(name = "idtypestatus", referencedColumnName = "idtypestatus")})
    @ManyToMany(fetch = FetchType.LAZY)
    private List<Typestatus> typestatusList;
    @JoinTable(name = "identificationidentifiedby", joinColumns = {
        @JoinColumn(name = "ididentificationelement", referencedColumnName = "ididentificationelement")}, inverseJoinColumns = {
        @JoinColumn(name = "ididentifiedby", referencedColumnName = "ididentifiedby")})
    @ManyToMany(fetch = FetchType.LAZY)
    private List<Identifiedby> identifiedbyList;
    @OneToMany(mappedBy = "identificationelement", fetch = FetchType.LAZY)
    private List<Specimen> specimenList;
    @JoinColumn(name = "ididentificationqualifier", referencedColumnName = "ididentificationqualifier")
    @ManyToOne(fetch = FetchType.LAZY)
    private Identificationqualifier identificationqualifier;

    public Identificationelement() {
    }

    public Identificationelement(Integer ididentificationelement) {
        this.ididentificationelement = ididentificationelement;
    }

    public Integer getIdidentificationelement() {
        return ididentificationelement;
    }

    public void setIdidentificationelement(Integer ididentificationelement) {
        this.ididentificationelement = ididentificationelement;
    }

    public Date getDateidentified() {
        return dateidentified;
    }

    public void setDateidentified(Date dateidentified) {
        this.dateidentified = dateidentified;
    }

    public String getIdentificationremark() {
        return identificationremark;
    }

    public void setIdentificationremark(String identificationremark) {
        this.identificationremark = identificationremark;
    }

    public List<Typestatus> getTypestatusList() {
        return typestatusList;
    }

    public void setTypestatusList(List<Typestatus> typestatusList) {
        this.typestatusList = typestatusList;
    }

    public List<Identifiedby> getIdentifiedbyList() {
        return identifiedbyList;
    }

    public void setIdentifiedbyList(List<Identifiedby> identifiedbyList) {
        this.identifiedbyList = identifiedbyList;
    }

    public List<Specimen> getSpecimenList() {
        return specimenList;
    }

    public void setSpecimenList(List<Specimen> specimenList) {
        this.specimenList = specimenList;
    }

    public Identificationqualifier getIdentificationqualifier() {
        return identificationqualifier;
    }

    public void setIdentificationqualifier(Identificationqualifier identificationqualifier) {
        this.identificationqualifier = identificationqualifier;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ididentificationelement != null ? ididentificationelement.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Identificationelement)) {
            return false;
        }
        Identificationelement other = (Identificationelement) object;
        if ((this.ididentificationelement == null && other.ididentificationelement != null) || (this.ididentificationelement != null && !this.ididentificationelement.equals(other.ididentificationelement))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Identificationelement[ididentificationelement=" + ididentificationelement + "]";
    }

}
